public class Student {
     private String studentId;
     private String name;
     private String gender;
     private Course selectedCourse;
     public String getGender() {
    return gender;
}
     public Student(String studentId, String name, String gender) {
         this.studentId = studentId;
         this.name = name;
         this.gender = gender;
     }
     public void selectCourse(Course course) {
         this.selectedCourse = course;
         System.out.println(name + " 已选课程：" + course.getCourseName());
     }
     public void dropCourse() {
         if (selectedCourse != null) {
             System.out.println(name + " 已退课：" + selectedCourse.getCourseName());
             this.selectedCourse = null;
         } else {
             System.out.println(name + " 暂无选课记录，无法退课");
         }
     }
     public void printCourseSchedule(Teacher teacher) {
         if (selectedCourse != null) {
             System.out.println("学生课表---");
             System.out.println("学生编号：" + studentId);
             System.out.println("课程编号：" + selectedCourse.getCourseId());
             System.out.println("课程名称：" + selectedCourse.getCourseName());
             System.out.println("上课地点：" + selectedCourse.getLocation());
             System.out.println("上课时间：" + selectedCourse.getTime());
             System.out.println("授课教师：" + teacher.getName());
         } else {
             System.out.println(studentId + " 暂无选课记录，课表为空");
         }
     }
     public String getStudentId() {
         return studentId;
     }
     public Course getSelectedCourse() {
         return selectedCourse;
     }
 }